const Router = require("koa-router");

const {
  verifyAuth,
  verifyAdminPermission,
} = require("../middleware/auth.middleware");

const {
  create,
  list,
  detail,
  update,
  remove,
  questionExpert,
  answerQuestion,
  recommendExpert,
  resultList,
  roundAnswerList,
} = require("../controller/question.controller.js");

const questionRouter = new Router({ prefix: "/question" });

questionRouter.post("/", verifyAuth, create);
questionRouter.get("/recommendExpert", recommendExpert);
questionRouter.get("/questionUser", roundAnswerList);
questionRouter.get("/result", resultList);
questionRouter.get("/", list);
questionRouter.get("/:questionId", detail);
questionRouter.put("/answerQuestion", verifyAuth, answerQuestion);
questionRouter.put("/", verifyAuth, update);
questionRouter.delete("/:questionId", verifyAuth, remove);
questionRouter.post("/questionExpert", verifyAuth, questionExpert);

module.exports = questionRouter;
